﻿using System;
using System.Data;
using System.Windows.Forms;

namespace SdmxMl.Panels
{
    public partial class DlgEditContactInfo : Form
    {
        private DataRow row = null;
        public DlgEditContactInfo()
        {
            InitializeComponent();
        }

        public void BindRow(DataRow row)
        {
            this.row = row;
            textBoxEmail.Text = row["Email"].ToString();
            textBoxUri.Text = row["URI"].ToString();
            textBoxTel.Text = row["Tel"].ToString();
            textBoxFax.Text = row["Fax"].ToString();
            textBoxX400.Text = row["X400"].ToString();
        }


        private void buttonClose_Click(object sender, EventArgs e)
        {
            // Update
            row["Email"] = textBoxEmail.Text;
            row["Tel"] = textBoxTel.Text;
            row["Fax"] = textBoxFax.Text;
            row["X400"] = textBoxX400.Text;
            row["URI"] = textBoxUri.Text;
            DialogResult = DialogResult.OK;
            // And close
            this.Close();

        }
    }
}
